<?php
class Bizprofile_DashboardController extends Zend_Controller_Action {

    public function init() {

    }
	/* TAM THOI KO CO SU DUNG DEN	*/
    public function indexAction() {
        $auth = Zend_Auth::getInstance();
        if ($auth->hasIdentity()) {
            $user = $auth->getIdentity();
            if(isset($user->enterprise->id) && $user->enterprise->id){
				$arrRoutes = array(
					'enterprise_id'			=> $user->enterprise->id,
					'enterprise_name'		=> Tomato_Utility_String::removeSign($user->enterprise->company_name_en, '-', true),
				);
                $this->_redirect($this->view->serverUrl().$this->view->url($arrRoutes, 'bizprofile_enterprise_index'));
            }else{
                $this->_redirect($this->view->baseUrl());
            }
        }
        else{
            $this->_redirect($this->view->serverUrl() . $this->view->url(array(), 'bizprofile_auth_login'));
        }
    }
}
